package com.gitee.huanminabc.web.controller;

import com.gitee.huanminabc.jcommon.reflect.MethodUtil;
import com.gitee.huanminabc.nullchain.common.NullResult;
import com.gitee.huanminabc.web.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.lang.ref.Reference;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Map;

/**
 * @program: java-huanmin-utils
 * @description: 测试
 * @author: huanmin
 * @create: 2024-12-09 15:21
 **/
@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {

    @Autowired
    private TestService testService;

    @GetMapping("/get")
    public NullResult<String> get1() {
        log.info("get1");
        testService.test();
        return NullResult.success("1231");
    }
    @GetMapping("/ge2")
    public NullResult<String> get2(@RequestParam Integer id) {
        log.info("get2");
        testService.test();
        return NullResult.success("1231");
    }

    public static void main(String[] args) {

        Method get2 = MethodUtil.getMethod(TestController.class, "get2", null);
        System.out.println();
    }
}
